﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Threading;

namespace ChinaGeo
{
    public class GoogleMapsRoadTileSource : Microsoft.Phone.Controls.Maps.TileSource
    {
        string hl = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName;

        public GoogleMapsRoadTileSource()
            : base("http://mt{0}.google.com/vt/lyrs=m@128&hl={4}&x={1}&y={2}&z={3}&s=")
        { }
        public override System.Uri GetUri(int x, int y, int zoomLevel)
        {
            return new System.Uri(string.Format(UriFormat, new System.Random().Next() % 4, x, y, zoomLevel, hl));
        }
    }
}
